<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Tipask's Control Panel</title>
        <meta http-equiv="Content-Type" content="text/html; charset={TIPASK_CHARSET}">
        <link media="all" type="text/css" href="css/admin/admincp.css" rel="stylesheet"/>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/jqueryui.js"></script>
        <script type="text/javascript" src="js/admin.js" ></script>
    </head>
    <body>
        <div id="append">
        </div>
        <div class="container">
            <!--{if !empty($message)}-->
            <!--{eval $type=isset($type)?$type:'correctmsg'; }-->
            <div class="{$type}"><p>{$message}</p></div>
            <!--{/if}-->

            <div class="mainbox">
                <table class="datalist fixwidth">
                    <tr>
                        <th width="20%">提示文字</td>
                        <th width="15%">字段名称</td>
                        <th width="15%">数据类型</td>
                        <th width="15%">状态[操作]</td>
                        <th>编辑[删除]</td>
                    </tr>
                    <tr>
                        <td colspan="5" >
                            <ul id="list" style="cursor: hand; cursor: pointer;" >
                                <!--{loop $userfieldlist $userfield}-->

                                <li style="list-style:none;">
                                    <table width="74%" style="text-align:left;" class="xhe_default">
                                        <tr>
                                            <td width="22%">{$userfield['title']}    <input type="hidden" name="id[]" value="{$userfield['id']}" /></td>
                                            <td width="15%">{$userfield['name']} </td>
                                            <td width="15%">{$userfield['type']}</td>
                                            <td width="15%">
										 <!--{if $userfield['state'] }-->已启用
											<a style="color: green" href="index.php?c=admin_field&a=enable&id=$userfield['id']&state=0">[禁用]</a>
										 <!--{else}-->已禁用
											<a style="color: red" href="index.php?c=admin_field&a=enable&id=$userfield['id']&state=1">[启用]</a>
										 <!--{/if}-->
                                            </td>
                                            <td width="10%">
										 	<a   href="index.php?c=admin_field&a=edit&id=$userfield['id']">[编辑]</a>
										 	<a   href="index.php?c=admin_field&a=remove&id=$userfield['id']">[删除]</a>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <!--{/loop}-->
                            </ul>
                        </td>
                    </tr>
                </table>

                <script type="text/javascript">

                    $(document).ready(function() {
                        $("#list").sortable({
                            update : function () {
                                var order="";
                                var numValue=$("input[name='id[]']");
                                for(var i=0;i<numValue.length;i++){
                                    order+=$(numValue[i]).val()+",";
                                }
                                $.post("index.php?c=admin_field&a=order",{order:order});
                            }
                        });
                    });
                </script>

            </div>
        </div>
    </body>
</html>
